<template>
  <div class="base-container">
    <t-form ref="form" :data="queryParams" label-width="80"
      @submit="() => { this.pagination.current = 1; this.queryParams.pageNum = 1; this.getList() }"
      @reset="() => { this.pagination.current = 1; this.queryParams.pageNum = 1; this.getList() }">

      <t-row style="border-bottom: 1px solid #E5E6EB;margin-bottom: 10px">
        <t-col :span="11" class="query-form-inline">
          <t-form-item label="项目名称" name="projectName">
            <t-input v-model="queryParams.projectName" clearable placeholder="请输入项目名称" style="width: 240px" />
          </t-form-item>
          <t-form-item label="申报年度" name="declareYear">
            <t-date-picker style="width: 240px" v-model="queryParams.declareYear" mode="year" clearable />
          </t-form-item>
          <t-form-item label="承担单位" name="declareDeptName">
            <t-input v-model="queryParams.declareDeptName" clearable placeholder="请输入承担单位" style="width: 240px" />
          </t-form-item>
          <t-form-item v-if="site_tag === 'jtt'" label="计划类别" name="projectCategoryprojectCategory">
            <t-tree-select expand-all clearable v-model="queryParams.projectCategory" style="width: 300px"
              :treeProps="{ keys: { value: 'id', label: 'name' } }" :data="projectCategoryOptions"></t-tree-select>
          </t-form-item>
          <t-form-item label="学科分类" name="subjectClassification">
            <t-select style="width: 240px" clearable v-model="queryParams.subjectClassification"
              :options="dict.type.subject_classification">
            </t-select>
          </t-form-item>
          <t-form-item label="项目类别" name="projectType">
            <t-select style="width: 240px" clearable v-model="queryParams.projectType"
              :options="dict.type.project_type">
            </t-select>
          </t-form-item>
          <t-form-item label="项目状态" name="projectStatus">
            <t-select style="width: 240px" clearable v-model="queryParams.projectStatus"
              :options="dict.type.project_status">
            </t-select>
          </t-form-item>
          <t-form-item label="建议经费总概算">
            <t-form-item name="startAdviceFunding">
              <t-input v-model="queryParams.startAdviceFunding" clearable placeholder="大于等于" style="width: 120px" />
            </t-form-item>-<t-form-item name="endAdviceFunding"> <t-input v-model="queryParams.endAdviceFunding"
                clearable placeholder="小于等于" style="width: 120px" />
            </t-form-item>
          </t-form-item>
          <t-form-item :label="site_tag === 'jtt' ? '厅拨经费' : '集团补助经费'">
            <t-form-item name="startSubsidyFunding">
              <t-input v-model="queryParams.startSubsidyFunding" clearable placeholder="大于等于" style="width: 120px" />
            </t-form-item> - <t-form-item name="endSubsidyFunding">
              <t-input v-model="queryParams.endSubsidyFunding" clearable placeholder="小于等于" style="width: 120px" />
            </t-form-item>
          </t-form-item>
          <t-form-item label="项目负责人" name="projectLeaderName">
            <t-input v-model="queryParams.projectLeaderName" clearable style="width: 240px" />
          </t-form-item>
          <t-form-item label="项目成员" name="projectMemberName">
            <t-input v-model="queryParams.projectMemberName" clearable style="width: 240px" />
          </t-form-item>

          <t-form-item label="申报日期" name="declareDateRange">
            <t-date-range-picker style="width: 280px" :placeholder="['开始时间', '结束时间']"
              v-model="queryParams.declareDateRange" allow-input clearable />
          </t-form-item>
          <t-form-item label="项目时间" name="projectDateRange">
            <t-date-range-picker style="width: 280px" v-model="queryParams.projectDateRange"
              :placeholder="['开始时间', '结束时间']" allow-input clearable />
          </t-form-item>
        </t-col>
        <t-col :span="1" class="operation-container">
          <t-button theme="primary" type="submit"> 查询</t-button>
          <t-button theme="default" variant="outline" type="reset">重置</t-button>
        </t-col>
      </t-row>
    </t-form>
    <div class="btn-group-inline">
      <t-button @click="apply" variant="outline" theme="primary">
        <t-icon name="add" slot="icon" />
        申报
      </t-button>
      <t-button v-if="site_tag === 'jtt'" @click="oldApply" variant="outline" theme="primary">
        <t-icon name="add" slot="icon" />
        历史项目录入
      </t-button>
      <!-- <t-button v-else :disabled="true"  @click="oldApply" variant="outline" theme="primary">
        <t-icon name="add" slot="icon"/>
        历史项目录入
      </t-button> -->
    </div>
    <t-table rowKey="id" size="small" :data="data"
      :columns="site_tag === 'jtt' ? columns : columns.filter(val => { return val.title !== '计划类别' })" hover
      :pagination="pagination" :loading="dataLoading" :sort="sort" :hideSortTips="true" @sort-change="sortChange">
      <template #adviceFunding="{ row }">
        {{ row.adviceFunding }}万元
      </template>
      <template #subsidyFunding="{ row }">
        {{ row.subsidyFunding }}万元
      </template>
      <template #projectName="{ row }">
        <t-link v-if="row.version === '2024'"
          @click="dialog.objId = row.id; dialog.header = row.projectName; dialog.open_item_detail = true" hover="color"
          theme="primary">{{ row.projectName }}</t-link>
        <t-link v-else
          @click="dialog.objId = row.id; dialog.header = row.projectName; dialog.open_project_detail = true"
          hover="color" theme="primary">{{ row.projectName }}</t-link>
      </template>
      <template #subjectClassification="{ row }">
        {{ row.subjectClassification | filterByDict(dict.type.subject_classification) }}
      </template>
      <template #projectType="{ row }">
        {{ row.projectType | filterByDict(dict.type.project_type) }}
      </template>
      <template #op="{ row }">
        <!-- <t-button v-if="row.projectStatus === '9' " @click="update(row,1)" size="small" variant="text"
                 class="t-button-link">
         <t-icon name="edit-1" slot="icon"/>
         编辑
        </t-button> -->
        <!--        <t-button v-if="row.isOldProject==='1'" @click="update(row,2)" size="small" variant="text"-->
        <!--                  class="t-button-link">-->
        <!--          <t-icon name="edit-1" slot="icon"/>-->
        <!--          编辑(历史数据录入)-->
        <!--        </t-button>-->

        <!-- 暂存、退回、形式审查中 -->
        <t-tooltip :content="row.updateInfoDate">
          <t-button v-if="isShowEdit(row)" @click="update(row, 1)" size="small" variant="text" class="t-button-link">
            <t-icon name="edit-1" slot="icon" />
            <!-- 根据专家意见修改 -->
            <!-- {{ row.isReviewStatus === '1'?'根据专家意见修改':'继续申报' }} -->
            {{ (row.projectStatus === '1' || row.projectStatus === '11-3') ? '继续申报' : row.projectStatus === '9' ?
              '根据专家意见修改'
              :
              (['98'].includes(row.projectStatus) || row.isReviewStatus === '1') ? '根据专家意见修改' : '编辑' }}
          </t-button>
        </t-tooltip>
        <t-button v-if="row.isOldProject === '1'" @click="update(row, 2)" size="small" variant="text"
          class="t-button-link">
          <t-icon name="edit-1" slot="icon" />
          继续申报(历史数据录入)
        </t-button>

        <t-button v-if="row.version === '2024'" size="small"
          @click="dialog.objId = row.id; dialog.header = row.projectName; dialog.current_open_project_detail_new = true"
          variant="text" class="t-button-link">
          <t-icon name="info-circle" slot="icon" />
          详情
        </t-button>

        <t-button v-else size="small"
          @click="dialog.objId = row.id; dialog.header = row.projectName; dialog.current_open_project_detail = true"
          variant="text" class="t-button-link">
          <t-icon name="info-circle" slot="icon" />
          详情
        </t-button>
        <t-tooltip content="如果导出的PDF有样式问题，请及时调整">
          <t-button @click="createPDF(row)" size="small" variant="text" class="t-button-link">
            <t-icon name="file-pdf" slot="icon" />
            导出PDF
          </t-button>
        </t-tooltip>
        <t-button v-if="['1'].includes(row.projectStatus) || row.isOldProject === '1'" theme="danger"
          @click="deleteProject(row)" size="small" variant="text" class="t-button-link">
          <t-icon name="delete" slot="icon" />
          删除
        </t-button>
      </template>
      <template #projectStatus="{ row }">
        <t-tag @click="dialog.header = row.projectName; dialog.objId = row.id; dialog.open_approve_list = true"
          class="cursor-pointer" :theme="handleTheme(row.projectStatus, dict.type.project_status)" variant="light">
          {{ row.projectStatus | filterByDict(dict.type.project_status) }}
          <template
            v-if="site_tag === 'jtt' && row.projectStatus == '9' &&
              (row.secondReviewType === '1' || row.projectCategory === 1660720633654 || row.projectCategory === 1662099020236)">
            <br />{{ '(待会议评审)' }}
          </template>
        </t-tag>
        <br />
        <t-button v-if="['9', '10', '12', '13', '98'].includes(row.projectStatus) && site_tag === 'jtt'" size="small"
          variant="text" theme="danger" class="t-button-link"
          @click="dialog.header = row.projectName; dialog.objId = row.id; dialog.open_expert_account_detail = true">导出专家账户信息</t-button>
      </template>
    </t-table>
    <project-detail-dialog tabDefaultValue="1" :header="dialog.header" :objId="dialog.objId"
      :visible.sync="dialog.open_project_detail" v-if="dialog.open_project_detail"></project-detail-dialog>
    <item-detail-dialog tabDefaultValue="1" :header="dialog.header" :objId="dialog.objId"
      :visible.sync="dialog.open_item_detail" v-if="dialog.open_item_detail"></item-detail-dialog>
    <approve-list :header="dialog.header" :objId="dialog.objId" :visible.sync="dialog.open_approve_list"
      v-if="dialog.open_approve_list"></approve-list>
    <project-file @reload="getList" :header="dialog.header" :objId="dialog.objId"
      :visible.sync="dialog.open_project_file" v-if="dialog.open_project_file"></project-file>
    <current-project-detail-dialog :header="dialog.header" :objId="dialog.objId"
      :visible.sync="dialog.current_open_project_detail"
      v-if="dialog.current_open_project_detail"></current-project-detail-dialog>
    <current-project-detail-dialog-new :header="dialog.header" :objId="dialog.objId"
      :visible.sync="dialog.current_open_project_detail_new"
      v-if="dialog.current_open_project_detail_new"></current-project-detail-dialog-new>
    <expert-account-detail-dialog :header="dialog.header" :objId="dialog.objId"
      :visible.sync="dialog.open_expert_account_detail"
      v-if="dialog.open_expert_account_detail"></expert-account-detail-dialog>
  </div>
</template>

<script>
import ApproveList from "../approve/components/approve-list.vue";
import ProjectFile from "../pm/components/project-file.vue";
import ProjectDetailDialog from "../pm/components/project-detail-dialog.vue";
import ItemDetailDialog from "../pm/components/item-detail-dialog.vue";
import CurrentProjectDetailDialog from './components/current-project-detail-dialog.vue'
import CurrentProjectDetailDialogNew from './components/current-project-detail-dialog-new.vue'
import ExpertAccountDetailDialog from './components/expert-account-detail-dialog.vue'

export default {
  name: "kjxm-apply-project-my",
  dicts: ["project_type", "subject_classification", "sys_user_sex", "prof_tit", "degree", "duty", "platform_type", "member_type", "project_status"],
  components: {
    ApproveList,
    ProjectFile,
    ProjectDetailDialog,
    ItemDetailDialog,
    CurrentProjectDetailDialog,
    CurrentProjectDetailDialogNew,
    ExpertAccountDetailDialog

  },
  data () {
    return {
      site_tag: import.meta.env.VITE_SITE_TAG,
      sort: [],
      dialog: {
        open_project_detail: false,
        header: "",
        objId: 0,
        open_approve_list: false,
        open_project_file: false,
        open_expert_account_detail: false,
        open_item_detail: false,
        current_open_project_detail: false,
        current_open_project_detail_new: false
      },
      dictTypes: {},
      projectCategoryOptions: [],
      columns: [
        // {
        //   colKey: "id",
        //   title: "项目编号",
        //   align: "center",
        //   ellipsis: true
        // },
        // {
        //   colKey: "declareDate",
        //   title: "申报年度",
        //   align: "center"
        // },
        {
          colKey: "projectName",
          title: "项目名称",
          align: "center",
          // ellipsis: true,
          width: 220

        },

        {
          colKey: "adviceFunding",
          title: "建议经费总概算",
          align: "center",
          width: 160,
          sorter: true,
        },
        {
          colKey: "subsidyFunding",
          title: import.meta.env.VITE_SITE_TAG === 'jtt' ? "厅拨经费" : `集团补助经费`,
          align: "center",
          sorter: true,
          width: 140,
        },
        {
          colKey: "startDate",
          title: "开始时间",
          align: "center",
          sorter: true,
          width: 120,
        },
        {
          colKey: "endDate",
          title: "结束时间",
          align: "center",
          sorter: true,
          width: 120,
        },
        {
          colKey: "projectLeaderName",
          title: "项目负责人",
          align: "center",
          width: 100
        },
        {
          colKey: "declareDeptName",
          title: "承担单位",
          align: "center",
          width: 180,
          sorter: true
        },
        {
          colKey: "projectCategoryName",
          title: "计划类别",
          align: "center",
          width: 120
        },
        {
          colKey: "subjectClassification",
          title: "学科分类",
          align: "center",
          width: 100
        },
        {
          colKey: "projectType",
          title: "项目类型",
          align: "center",
          width: 120
        },
        // {
        //   colKey: "attributeDeptName",
        //   title: "归口管理单位",
        //   align: "center"
        // },
        {
          colKey: "declareDate",
          title: "申报日期",
          align: "center",
          // ellipsis: true,
          width: 110,
          sorter: true,
        },
        {
          colKey: "projectStatus",
          title: "项目状态",
          align: "center",
          width: 220,
          fixed: 'right',
          sorter: true
        },
        {
          colKey: "op",
          title: "操作",
          align: "center",
          width: 180,
          fixed: 'right'
        },
      ],
      data: [],
      dataLoading: false,
      queryParams: {
        declareYear: '',
        projectDateRange: [],
        declareDateRange: [],
        declareDate: '',
        startDate: '',
        endDate: '',
        startDeclareDate: '',
        endDeclareDate: '',
        startAdviceFunding: null,
        endAdviceFunding: null,
        startSubsidyFunding: '',
        endSubsidyFunding: '',
        multilevelDeptId: null,
        projectLeaderName: '',
        projectMemberName: '',
        pageNum: 1,
        pageSize: 10,
        projectCategory: null,
        projectName: '',
        projectType: '',
        subjectClassification: '',
        dateRange: [],
        sortGroup: '',
        deptName: '',
        projectStatus: '',
        declareDeptName: ''
      },
      pagination: {
        current: 1,
        pageSize: 10,
        total: 0,
        showPageSize: true,
        pageSizeOptions: [10, 20, 30, 50],
        showFirstAndLastPageBtn: false,
        onChange: (pageInfo) => {
          Object.assign(this.pagination, pageInfo)
          this.queryParams.pageNum = pageInfo.current || 1;
          this.queryParams.pageSize = pageInfo.pageSize;
          this.getList()
        },
      },
    }
  },
  async created () {
    this.getDeclareTree();
    this.getList();
  },
  methods: {
    isShowEdit (row) {
      // 以及在projectStatus为9并且isFinishRevision为1的时候，我的申报列表的，按专家意见修改按钮也隐藏
      // const result = !(row.projectStatus == '9')
      // return (['1','6', '98', '5'].includes(row.projectStatus) ||
      //    (row.projectStatus === '9' && [1660720633654, 1662099020236].includes(row.projectCategory)) ||
      //    (row.projectStatus === '9' && row.projectCategory ===  1660720545908 && row.secondReviewType === '1') ||
      //     row.isReviewStatus==='1')
      //     && result
      const c1 = ['1', '6', '98', '5'].includes(row.projectStatus)
      // const c2 = row.projectStatus === '9' && [1660720633654, 1662099020236, 1660720545908].includes(row.projectCategory)
      const c2 = row.projectStatus === '9'

      const c4 = row.isReviewStatus === '1'
      const c5 = row.projectStatus === '11-3'
      return (c1 || c2 || c4 || c5)

    },
    createPDF (row) {
      const instance = this.$loading({
        fullscreen: true,
        attach: 'body',
        preventScrollThrough: false,
      });
      this.$api.kjxm.project.projectTestPDF(row.id).then(response => {
        window.open(response.data.fullFilePath, '_blank')
        instance.hide();
      }).catch((e) => {
        instance.hide();
        this.$message.error(e.toString());
      });
    },
    sortChange (sort) {
      this.sort = sort;
      let orderByColumn = []
      let isAsc = []
      if (sort instanceof Array) {
        orderByColumn = sort.map(val => val.sortBy)
        isAsc = sort.map(val => val.descending ? `desc` : `asc`)
      } else {
        orderByColumn = [sort.sortBy]
        isAsc = [sort.descending ? `desc` : `asc`]
      }
      this.queryParams.orderByColumn = orderByColumn.join(",")
      this.queryParams.isAsc = isAsc.join(",")
      this.getList();
    },
    getList () {
      this.dataLoading = true;
      [this.queryParams.startDate, this.queryParams.endDate] = this.queryParams.projectDateRange;
      [this.queryParams.startDeclareDate, this.queryParams.endDeclareDate] = this.queryParams.declareDateRange;
      this.$api.kjxm.project.applyMyList(this.queryParams).then(response => {
        this.pagination.total = response.total;
        this.data = response.rows;
        this.dataLoading = false;
      }).catch((e) => {
        this.dataLoading = false;
        this.$message.error(e.toString());
      });
    },
    getDeclareTree () {
      this.$api.kjxm.project.planCategoryList().then(response => {
        this.projectCategoryOptions = this.handleTree(response.data, "id");
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
    oldApply () {
      this.$router.push({
        path: `/kjxm/other/apply/project-apply/${Date.parse(new Date())}`,
        query: {
          isOldProject: '1',
          title: '项目申报(历史项目录入)'
        }
      });
    },
    apply () {
      // this.$router.push(`/kjxm/other/apply/project-apply/${Date.parse(new Date())}`);
      if (this.site_tag === 'jtt') {
        this.$router.push(`/kjxm/other/apply/item-apply/${Date.parse(new Date())}`);
      } else {
        this.$router.push(`/kjxm/other/apply/project-apply/${Date.parse(new Date())}`);
      }
    },
    update (row, type) {
      if (this.site_tag === 'jtt' && row?.version === '2024') {
        const taskId = row.id;
        sessionStorage.removeItem(`${taskId}-kjxm-project-activeForm`);
        this.$api.kjxm.project.getNewAll(row.id).then(response => {
          const activeFormList = [];
          sessionStorage.setItem(`${taskId}-kjxm-project-step1`, taskId);

          sessionStorage.removeItem(`${taskId}-kjxm-project-step2`);
          if (response.data.projectOverview && response.data.projectOverview.id) {
            sessionStorage.setItem(`${taskId}-kjxm-project-step2`, response.data.projectOverview.id)
          } else {
            activeFormList.push(2);
          }
          if (response.data.projectMembers && response.data.projectMembers.length > 0) {
            sessionStorage.setItem(`${taskId}-kjxm-project-step3`, response.data.projectMembers.length)
          } else {
            activeFormList.push(3);
          }
          if (response.data.projectBudget && response.data.projectBudget.id) {
            sessionStorage.setItem(`${taskId}-kjxm-project-step4`, response.data.projectBudget.id)
          } else {
            activeFormList.push(4);
          }
          if (response.data.researchPlanList && response.data.researchPlanList.length > 0) {
            sessionStorage.setItem(`${taskId}-kjxm-project-step5`, response.data.researchPlanList.length)
          } else {
            activeFormList.push(5);
          }
          if (response.data.expectResultsList && response.data.expectResultsList.length > 0) {
            sessionStorage.setItem(`${taskId}-kjxm-project-step6`, response.data.expectResultsList.length)
          } else {
            activeFormList.push(6);
          }
          if (response.data.feasibilityReport && response.data.feasibilityReport.id) {
            sessionStorage.setItem(`${taskId}-kjxm-project-step7`, response.data.feasibilityReport.id)
          } else {
            activeFormList.push(7);
          }
          if (response.data.personResultsList && response.data.personResultsList.length > 0) {
            sessionStorage.setItem(`${taskId}-kjxm-project-step8`, response.data.personResultsList.length)
          } else {
            activeFormList.push(8);
          }
          if (response.data.projectCompanyList && response.data.projectCompanyList.length > 0) {
            sessionStorage.setItem(`${taskId}-kjxm-project-step9`, response.data.projectCompanyList.length)
          } else {
            activeFormList.push(9);
          }
          if (activeFormList.length <= 0) {
            sessionStorage.setItem(`${taskId}-kjxm-project-activeForm`, 10); // 跳转到最后一步
          } else {
            sessionStorage.setItem(`${taskId}-kjxm-project-activeForm`, activeFormList[0]); // 跳转到第一个不满足
          }
          let isShowSubmitBtn = "false"
          if ((['9'].includes(row.projectStatus) && [1660720633654, 1662099020236].includes(row.projectCategory)) ||
            (row.projectStatus === '9' && row.projectCategory === 1660720545908 && row.secondReviewType === '1') ||
            row.projectStatus === '8') {
            isShowSubmitBtn = "true";
          }
          isShowSubmitBtn = this.isShowEdit(row) ? "false" : "true"
          if (['1', '6', '98'].includes(row.projectStatus)) {
            isShowSubmitBtn = "true";
          }
          this.$router.push({
            path: `/kjxm/other/apply/item-apply/${taskId}/${isShowSubmitBtn}`,
            query: {
              title: `${response.data.projectName}-项目申报`,
              projectStatus: row.projectStatus,
              secondReviewType: row.secondReviewType
            }
          });
        }).catch((e) => {
          this.$message.error(e.toString());
        });
      } else {
        this.$api.kjxm.project.getAll(row.id).then(response => {
          const taskId = row.id;
          const activeFormList = [];
          sessionStorage.setItem(`${taskId}-projectId`, row.id);
          if (response.data.projectBackground && response.data.projectBackground.id) {
            sessionStorage.setItem(`${taskId}-backgroundId`, response.data.projectBackground.id)
          } else {
            activeFormList.push(1);
          }
          if (response.data.projectApproach && response.data.projectApproach.id) {
            sessionStorage.setItem(`${taskId}-approachId`, response.data.projectApproach.id)
          } else {
            activeFormList.push(2);
          }
          if (response.data.projectBasicstudy && response.data.projectBasicstudy.id) {
            sessionStorage.setItem(`${taskId}-basicstudyId`, response.data.projectBasicstudy.id)
          } else {
            activeFormList.push(3);
          }
          if (response.data.projectCompanyList && response.data.projectCompanyList.length > 0) {
            sessionStorage.setItem(`${taskId}-companyId`, response.data.projectCompanyList.length)
          } else {
            activeFormList.push(4);
          }
          if (response.data.projectMembers && response.data.projectMembers.length > 0) {
            sessionStorage.setItem(`${taskId}-memberId`, response.data.projectMembers.length)
          } else {
            activeFormList.push(5);
          }
          if (response.data.projectBudget && response.data.projectBudget.id) {
            sessionStorage.setItem(`${taskId}-budgetId`, response.data.projectBudget.id)
          } else {
            activeFormList.push(6);
          }
          if (activeFormList.length <= 0 && type === 1) {
            sessionStorage.setItem(`${taskId}-activeForm`, 7); // 跳转到最后一步
          } else {
            sessionStorage.setItem(`${taskId}-activeForm`, activeFormList[0]); // 跳转到第一个不满足
          }
          if (row.isOldProject === '1') {
            this.$router.push({
              path: `/kjxm/other/apply/project-apply/${taskId}`,
              query: {
                title: response.data.projectName,
                projectStatus: row.projectStatus,
                isOldProject: '1',
              }
            });
          } else {
            this.$router.push({
              path: `/kjxm/other/apply/project-apply/${taskId}`,
              query: {
                title: response.data.projectName,
                projectStatus: row.projectStatus
              }
            });
          }

        }).catch((e) => {
          this.$message.error(e.toString());
        });
      }
    },
    deleteProject (row) {
      const confirmDia = this.$dialog.confirm({
        header: "系统提示",
        body: `是否确认删除项目名称为"${row.projectName}"的数据项？`,
        theme: "warning",
        onConfirm: ({ e }) => {
          confirmDia.update({
            confirmBtn: {
              loading: true,
            },
          })
          this.$api.kjxm.project.del(row.id).then(
            (res) => {
              this.getList();
              this.$message.success("删除成功");
              // 请求成功后，销毁弹框
              confirmDia.destroy();
            }
          ).catch((e) => {
            confirmDia.update({
              confirmBtn: {
                loading: false,
              },
            })
            this.$message.error(e.toString());
          });
        }
      });
    },
  },
}
</script>

<style scoped></style>
